//
//  RoundedCorners.swift
//  Maze24
//
//  Created by Mars on 2020/11/6.
//

import UIKit
import SwiftUI

struct RoundedCorners: Shape {
  var cornerRadius: CGFloat = .infinity
  var corners: UIRectCorner = .allCorners
  
  func path(in rect: CGRect) -> Path {
    let path = UIBezierPath(
      roundedRect: rect,
      byRoundingCorners: corners,
      cornerRadii: CGSize(width: cornerRadius, height: cornerRadius))
    
    return Path(path.cgPath)
  }
}
